The next command, dopus error , is used to provide more meaningful error
messages, rather than just a code like 1, 5, 10, etc.
If you have created a script that keeps failing because you have provided
an incorrect handle to a lister query command, all that is reported to
you is the error code: 10.
You could have a short script in your DOpus5:ARexx/ directory like the
following:
/* DOpusError.dopus5 */
address 'DOPUS.1'
dopus getstring '"Please enter error code:" 2 "" OK|Cancel' /* Ask for code */
if dopusrc = 0 then exit /* If Cancel then exit */
ec = result /* Save error code entered */
dopus error ec /* Pass error code to DOpus for interpretation */
text = "Error code "ec": "result /* Format result into a string */
dopus request '"'text'" OK' /* Display error text in requester */
exit
Then when you get an error code running a Opus script, you could execute
the above script:
'rx DOpus5:ARexx/DOpusError.dopus5'
It would prompt you for the error code, then tell you what it meant.
The command could also be used to inform users of your scripts that
there was a problem, this could then be referred back to you, providing
you with important fault finding information.
NOTE: This is only true for Opus ARexx error codes, if you give
it a normal ARexx error code then you might end up with
the completely wrong answer.
You can see a list of valid Opus ARexx error codes here .
|